--[[
* 能量变更后
*]]
---@class BuffEffect88 : BaseBuffEffect
BuffEffect88 = ClientFight.CreateClass("BuffEffect88", ClientFight.BaseBuffEffect)
local t = BuffEffect88
---@param fight Fight
---@param buff FighterBuff

function t:action(fight, buff, ...)
    local buffEffectValue = buff.buffBean.f_BuffEffectValue;
    for i = 3, table.getn(buffEffectValue) do
        local existingBuff = BuffManager.getBuffByModel(buff.target, buffEffectValue[i]);
        if (existingBuff ~= nil) then
            t:doCalculateDuration(fight, buff, existingBuff);
        end
    end
    return ClientFight.BaseBuffEffect.action(self, fight, buff, parameters);
end

function t:doCalculateDuration(fight, buff, targetBuff)
    local type = buff.buffBean.f_BuffEffectValue[1];
    local intervalRatio = buff.buffBean.f_BuffEffectValue[2];
    local duration = 0;
    if (type == 0) then
        duration = intervalRatio;
    else
        duration = calcRatio(targetBuff.continuedTime, intervalRatio);
    end
    targetBuff.continuedTime = targetBuff.continuedTime + duration;
    local logduration = duration;
    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
            .. buff.modelId .. " 延长目标buff " .. targetBuff.buffBean.f_BuffId .. " 时长：" .. logduration);
end

t.New()